// pages/header/header.js
Component({
   properties:{
   num:{
     type:Number,
     value:0
   }
},
  data: {//当前页面定义的变量
        seller:{},
        imgurl:[
             "/images/tab2.jpg",
             "/images/tab1.png",
             "/images/nx.jpg"
        ],
        navcolor:0,
  },
  methods:{
  onLoad: function (options) {
     var th=this
       wx.request({
         url: 'http://39.96.28.43:8000/data.json',
         method:"GET",
         header:"application/json",
         success:function(res){
           console.log(res)
           th.setData({seller:res.data.seller})
         }
       })
  },


  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },
  //菜单被点击
  navfun:function(e){
    this.setData({navcolor:e.currentTarget.dataset.num})
    if(e.currentTarget.dataset.num==0){
          wx.redirectTo({
            url: '/pages/index/index',
          })
    }
    else if(e.currentTarget.dataset.num==1){
      wx.redirectTo({
        url: '/pages/appraise/appraise',
      })
    }
    else{
      wx.redirectTo({
        url: '/pages/seller/seller',
      })
    }
  },
},
})